import { PetAttrPanel } from "./PetAttrPanel";
import { GTextFormat } from "../../../common/GTextFormat";
import { ObjCreate } from "../common/ObjCreate";
import { ImagesConst } from "../../resource/ImagesConst";
import { GlobalStyle } from "../../../common/global/GlobalStyle";
import { GTextFiled } from "../../../../com/mui/controls/GTextFiled";
import { DisplayUtil } from "../../../common/DisplayUtil";
type int = number;
//class PetRebornAttrPanel
    
    export  class PetRebornAttrPanel extends PetAttrPanel
    {
        constructor(arg1: Array<any>=null, arg2: GTextFormat=null, arg3: GTextFormat=null, arg4: GTextFormat=null, arg5: int=20)
        {
            super(arg1, arg2, arg3, arg4, arg5);
            this._arrowArr = [];
            this._rebornAdd = [];
            this.init();
            return;
        }

        /* internal  */init(): void
        {
            var loc2=null;
            var loc3=null;
            var loc1=_attrLabelArray.length;
            var loc4=0;
            while (loc4 < _attrLabelArray.length) 
            {
                loc2 = ObjCreate.createBitmap(ImagesConst.RangeRaise, 145, -1);
                loc3 = ObjCreate.createGTextField("", 158, 0, 30, 20, null, GlobalStyle.textFormat4);
                this._arrowArr.push(loc2);
                this._rebornAdd.push(loc3);
                ++loc4;
            }
            return;
        }

        public updateRebornAddValue(arg1: Array<any>): void
        {
            var loc1=null;
            var loc2=null;
            var loc3=null;
            var loc4=0;
            var loc5=_attrTxtArray.length;
            var loc6=0;
            while (loc6 < loc5) 
            {
                loc4 = arg1[loc6];
                loc3 = this._arrowArr[loc6] as Object /* flash.display.Bitmap */;
                loc1 = _attrTxtArray[loc6] as Object /* flash.text.TextField */;
                loc2 = this._rebornAdd[loc6] as GTextFiled;
                if (loc4 > 0 && loc1.visible) 
                {
                    loc3.y = loc1.y;
                    loc2.text = loc4.toString();
                    loc2.y = loc1.y;
                    this.addChild(loc3);
                    this.addChild(loc2);
                }
                else 
                {
                    DisplayUtil.removeMe(loc3);
                    DisplayUtil.removeMe(loc2);
                }
                ++loc6;
            }
            return;
        }

        public /* override */ clear(): void
        {
            var loc1=null;
            var loc2=null;
            super.clear();
            var loc3=_attrTxtArray.length;
            var loc4=0;
            while (loc4 < loc3) 
            {
                loc2 = this._arrowArr[loc4] as Object /* flash.display.Bitmap */;
                loc1 = this._rebornAdd[loc4] as GTextFiled;
                DisplayUtil.removeMe(loc2);
                DisplayUtil.removeMe(loc1);
                ++loc4;
            }
            return;
        }

        /* internal */ /* var */_arrowArr: Array<any>;

        /* internal */ /* var */_rebornAdd: Array<any>;
    }
